
<div class="container">

    <?php
    include 'member-left.php';
     $aid = ($_GET['aid'])?intval($_GET['aid']):0;
    $rsImage = $member->listMyImage();
    ?>
 
    <div class="col_r w765">
        <div class="yoh">
            <div class="avatar">
                <a href="/thanh-vien?mid=<?php echo $_SESSION['mem']['id']; ?>" title="<?php echo $_SESSION['mem']['fullname']; ?>">
                    <img src="<?php echo $common->get_avatar_thumb($_SESSION['mem']['avatar']); ?>" width="50" />
                </a>
            </div>

            <h2>Album <?php echo $rsImage['arrAlbum']['name']; ?><br><i>của <b>
                        <a href="/thanh-vien?mid=<?php echo $_SESSION['client']['id']; ?>"><?php echo $_SESSION['mem']['fullname']; ?></a></b><b class="last"><a href="/thanh-vien?mid=<?php echo $_GET['mid']; ?>&action=xemalbum">Xem tất cả album</a></b></i>
                <?php if ($member->isOwner()) { ?><div class="right"><input type="button"  id="btnUpload" name="btnUpload" value="Tải ảnh lên" class="btnBlogComment left" rel="<?php echo $aid;?>"></div><?php }?>
            </h2>

            <div class="clear"></div>
        </div>


        <div class="photo-list">
            <ul>
                <?php
                while ($row = $db->fetch_array($rsImage['rs'])) {
                    echo '<li id="image_id_' . $row['id'] . '" >
                        <div class="photo-dis">
                                <a class="photo-border" href="thanh-vien?mid=' . $row['mid'] . '&aid=' . $row['aid'] . '&image_id=' . $row['id'] . '&action=xemanh">
                                    <img src="' . $common->get_img_thumb($row['image']) . '"/>
                                </a>
                                ';
                    if ($member->isOwner()) {
                        echo '<span onclick="Lightbox.showConfirm(\'Xác nhận xóa ảnh\', \'Bạn có chắc muốn xóa ảnh này không?\', \'removeImage(' . intval($row['id']) . ')\');" class="removeImage" title="Xóa ảnh này"></span>';
                    }
                    echo'                         
                                </div>
                            
                          </li>';
                }
                ?>
            </ul>
        </div>

        <?php
        if ($rsImage['totalPage'] > 1) {
            ?>
            <div class="dangtin_un">
                <span class="dt_un_r">
                    <?php
                    $page = $rsImage['page'];
                    if ($page < 1) {
                        $page = 1;
                    } else {
                        $pagePre = $page - 1;
                        $pageNext = $page + 1;
                        if ($rsImage['page'] <= 1) {
                            $htmlPre = 'Trang trước';
                        } else {
                            $htmlPreLink = '/thanh-vien?mid=' . $_GET['mid'] . '&aid=' .$_GET['aid']. '&action=anhcuatoi&page=' . $pagePre;
                            $htmlPre = '<a href="' . $htmlPreLink . '">Trang trước</a>';
                        }
                        if ($rsImage['page'] == $rsImage['totalPage']) {
                            $htmlNext = 'Trang sau';
                        } else {
                            $htmlNextLink = '/thanh-vien?mid=' . $_GET['mid'] . '&aid=' .$_GET['aid']. '&action=anhcuatoi&page=' . $pageNext;
                            $htmlNext = '<a href="' . $htmlNextLink . '">Trang sau</a>';
                        }
                    }
                    echo $htmlPre . ' | ' . $htmlNext;
                    ?>
                </span>
            </div>
            <?php
        }
        ?>
    </div>
</div>

<script src="/js/my-image.js" type="text/javascript"></script>